﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Meteoric.Page;
using Shanbay.Core;
using Shanbay.Model;

namespace Shanbay.Page
{
    public class Callback : ShanbayPage
    {
        public int SetToken()
        {
            SToken token = new SToken()
            {
                Token = Request.ToStr("access_token"),
                Type = Request.ToStr("token_type"),
                State = Request.ToStr("state"),
                Expires = Request.ToStr("expires_in"),
                Scope = Request.ToStr("scope"),
            };
            //token.Token = "2K6Fe2X3sqqzJTNXdE1AMvQNR0taDz";
            //token.Type = "Bearer";
            //token.State = "";
            //token.Expires = "2592000";
            //token.Scope = "read+write";
            if (string.IsNullOrEmpty(token.Token))
            {
                return 0;
            }
            SetToken(token);
            return 1;
        }
    }
}
